package com.bodystm.temperature.bed;

import java.text.NumberFormat;

import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.bodystm.temperature.patient.Patient;
import com.bodystm.temperature.server.Temperature;
//import com.bodystm.temperature.server.Temperature;
import com.mimosa.common.entity.BaseEntity;
import com.mimosa.common.system.user.TUser;

/**
 * 鐥呬汉淇℃伅
 * 
 * @author ggeagle
 *
 */
@Table(name = "T_Bed")
@Entity
public class Bed extends BaseEntity {
	/**
	 * 濮撳悕
	 */
	private String name;
	/**
	 * 搴婁綅鐨勭姸鎬佷俊鎭�
	 */
	private String status;

	@ManyToOne(cascade = { javax.persistence.CascadeType.REFRESH })
	private TUser user;

	public TUser getUser() {
		return user;
	}

	//
	public void setUser(TUser user) {
		this.user = user;
	}

	/**
	 * 浣撴俯淇℃伅
	 */
	@Transient
	private Patient patient;

	public Patient getPatient() {
		return patient;
	}

	public void setPatient(Patient patient) {
		this.patient = patient;
	}

	/**
	 * 浣撴俯淇℃伅
	 */
	@Transient
	private Temperature tiwen;

	public Temperature getTiwen() {
		return tiwen;
	}

	public String getTiwenValue() {
		NumberFormat nf = NumberFormat.getNumberInstance();
		nf.setMaximumFractionDigits(2);
		return nf.format(this.tiwen);
	}

	public void setTiwen(Temperature tiwen) {
		this.tiwen = tiwen;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}
}